Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e0e4878ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| handle = await self.nexus_client.start_operation( | ||
| MyNexusService.my_workflow_run_operation, | ||
| MyInput(name), | ||
| ) | ||
| # Create a task that waits for the operation result | ||
| tasks.append(asyncio.create_task(handle)) |
There was a problem hiding this comment.
Avoid passing Nexus handle directly to create_task
In this workflow the object returned by start_operation is an awaitable handle (see the hello_nexus sample where it is only awaited). asyncio.create_task requires a coroutine object, so passing the handle directly will raise TypeError: a coroutine was expected at runtime and prevent any operation from running. To run these concurrently, wrap the awaitable in a coroutine or use asyncio.ensure_future(handle) (which accepts awaitables) so the tasks can actually be scheduled.
Useful? React with 👍 / 👎.
Add sample for Nexus cancellation based on the similar samples for Dotnet and Java